<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use backend\helpers\ActionButton;

/* @var $this yii\web\View */
/* @var $model backend\models\Contractor */

$this->title = $model->name_short_opf;
$this->params['breadcrumbs'][] = ['label' => 'Контрагенты', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<div class="container contractor-view">

    <h1 class="main-title"><?= Html::encode($this->title) ?></h1>

    <p>
        <?= ActionButton::update($model->id, 'updateContractor') ?>
        <?= ActionButton::delete($model->id, 'Вы точно хотите удалить контрагента?', 'deleteContractor') ?>
        <?= ActionButton::custom('Получить данные', 'updateContractor', 'get-data', ['id' => $model->id], 'btn-primary') ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'options' => ['class' => 'table table-striped detail-view'],
        'attributes' => [
            'id',
            'inn',
            'kpp',
            'ogrn',
            //'name',
            'name_full_opf',
            'name_short_opf',
            //'fio_ip',
            'okpo',
            'management',
            'address',
            'email:email',
            'phone',
        ],
    ]) ?>
    <br>
    <h1 class="main-title">Платежные реквизиты</h1>
    <?= DetailView::widget([
        'model' => $model,
        'options' => ['class' => 'table table-striped detail-view'],
        'attributes' => [
            'checking_account',
            'correspondent_account',
            'bank_name',
            'bank_bik',
        ],
    ]) ?>

</div>
